/*
 * @lc app=leetcode.cn id=564 lang=java
 *
 * [564] 寻找最近的回文数
 */

// @lc code=start
class Solution {
    public String nearestPalindromic(String n) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            int start = nums[i], count = 0;
            do {
                start = nums[start];
                count++;
            } while (start != nums[i]);
            res = Math.max(res, count);

        }
        return res;
    }
}
// @lc code=end
